<template>
  <div
    v-clipboard:copy="copyValue"
    v-clipboard:success="() => $message.success('Copy Successfully')"
    v-clipboard:error="() => $message.error('Copy Fail')"
    class="CopyItem"
    title="点击复制"
  >
    <slot>
    </slot>
  </div>
</template>

<script lang="ts">
import { Prop, Component, Vue } from 'vue-property-decorator'

// 复制组件
@Component
export default class CopyItem extends Vue {
  @Prop()
  public copyValue: any;
}
</script>

<style lang="scss" scoped>
.CopyItem {
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    height: 25px;
    &:hover {
        color: rgb(168, 165, 165);
    }
}
</style>
